A surveillance camera may operate for 24 hours a day, therefore, extremely bright images and extremely dark images are constantly being recorded. The general automatic gain control of the camera often cannot keep up with an extremely large change. Also, when extremely dark and bright parts are mixed within the same picture, such as an indoor window, this cannot be dealt with by conventional automatic gain control.
As a conventional image evaluation technique, a method is known that uses a histogram to make a graph using a number of pixels, according to the brightness of each color. This method shows the pixel distribution in the image, it displays the detail of a shadow (the left-hand portion of the histogram), a halftone (the center of the histogram) and the highlight (the right-hand portion of the histogram), and judges whether this detail makes sufficient amendment to an image for it to be clearly seen.
For example, an imaging device is described in Patent document 1. This imaging device comprises; an imaging element to output an electrical signal performing photoelectric conversion of an optics image, signal processing means to generate a video signal processing electrical signal output by said imaging element, a histogram circuit which generates a histogram from a video signal output by the said signal processing means, and an exposure control means using a histogram detected by the said histogram circuit.
An image processing method is described in Patent document 2. This image processing method comprises; a process to generate an image data by reading light from a manuscript, a process to make a histogram of the density distribution from the image data, a process to generate a density amendment curve based on a ratio of the number of the data of the part which came close to the light and shade at both ends of the density distribution corresponding to the number of the entire data of the image data, a process to make a density amendment of the image data using the density amendment curve.
An imaging device is described in Patent document 3. This imaging device provides an imaging means and a gradation correcting means, the imaging means images a subject, and the image data of the subject is acquired, the gradation correcting means makes a harmony amendment to a pixel portion which is a predetermined pixel portion of the imaging image consisting of image data acquired by imaging means and to a pixel portion comprising the pixels that have a brightness level which is within a predetermined range.    Regarding Patent document 1, it is difficult for still image photography in real time when a CPU with a large processing capacity is not used with a picture which contains a large number of pixels.    Regarding Patent document 2, when a high capacity host computer is not used, there are problems in that the processing time is greatly increased.    Regarding Patent document 3, there is a problem with this method in that it is not practical for a moving image, because it takes too much time to calculate a histogram of the whole picture with a large number of pixels.
Then the inventor of this invention suggested an image processing device described in Patent document 4.—an image processing device which converts the brightness of the image by image scanning in one pass (step). Comprising:
Means for determining a histogram (hist i) of brightness information (i) about the locomotive area of a predetermined pattern including the scanning position of the image scanning,
Means for determining cumulative frequencies (n) by accumulating the histogram (hist i) in the range of i≦p (p is the brightness information before the conversion of the scanning position),
Means for converting brightness information (p) of the scanning position into brightness information depending on cumulative frequencies (n).